<template>
    <div>
            <!-- 面包屑导航 -->
        <el-breadcrumb separator="->">
        <el-breadcrumb-item :to="{ path: '/welcome' }">首页</el-breadcrumb-item>
        <el-breadcrumb-item>信息管理</el-breadcrumb-item>
        </el-breadcrumb>
        <el-row>
            <el-col v-for="(item,index) in departments" :key="item.id" :span="7" style="margin-right:22px;margin-bottom:10px;">
                <el-card shadow="hover">
                    {{departments[index].departmentName}}

                    <el-divider></el-divider>
                    <el-form v-for="(item,index1) in departments[index].devices" :key="item.id">
                        <el-form-item label="设备编码：">
                            <span>{{departments[index].devices[index1].deviceNum}}</span>
                        </el-form-item>
                        <el-form-item label="设备名称：">
                            <span>{{departments[index].devices[index1].deviceName}}</span>
                        </el-form-item>
                        <el-form-item label="设备类型：">
                            <span>{{departments[index].devices[index1].deviceTypeNum}}</span>
                        </el-form-item>
                        <el-divider></el-divider>
                    </el-form>
                    
                </el-card>
            </el-col>
        </el-row>
    </div>

</template>

<script>
export default {
    data(){
        return{         
            departments:{

            }
        }
    },
    methods:{
        async getHospitalInfo(){
            const{data:res} = await this.$http.get("/hospital/getDepDev")
            this.departments = res;
        }
    },
    created(){
        this.getHospitalInfo();
    },
}
</script>

<style lang = "less" scoped>
.el-breadcrumb{
    margin-bottom: 15px;
    font-size: 17px;
    
}
</style>